//
//  MYGResumePaceView.swift
//  MYDoctor
//
//  Created by 小火科技 on 2024/4/12.
//

import UIKit

class MYGResumePaceView: UIView {

   
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        configUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
   open func setPace(index:Int){
        //re_normal re_back
       print(index)
        switch index {
        case 1:
            oneBtn2.setBackgroundImage(UIImage(named: "re_normal"), for: .normal)
            titleLabel2.textColor = .rgba(54, 54, 54, 1)
            img2.image = UIImage(named: "re_nextN")
            
            oneBtn3.setBackgroundImage(UIImage(named: "re_normal"), for: .normal)
            titleLabel3.textColor = .rgba(54, 54, 54, 1)
            img3.image = UIImage(named: "re_nextN")
            
        case 2:
            oneBtn2.setBackgroundImage(UIImage(named: "re_back"), for: .normal)
            titleLabel2.textColor = .rgba(54, 54, 54, 1)
            img2.image = UIImage(named: "re_n")
            
            oneBtn3.setBackgroundImage(UIImage(named: "re_normal"), for: .normal)
            titleLabel3.textColor = .rgba(54, 54, 54, 1)
            img3.image = UIImage(named: "re_nextN")
            
        case 3:
            oneBtn2.setBackgroundImage(UIImage(named: "re_back"), for: .normal)
            titleLabel2.textColor = .rgba(54, 54, 54, 1)
            img2.image = UIImage(named: "re_n")
            
            oneBtn3.setBackgroundImage(UIImage(named: "re_back"), for: .normal)
            titleLabel3.textColor = .rgba(54, 54, 54, 1)
            img3.image = UIImage(named: "re_n")
        case 4:
            oneBtn2.setBackgroundImage(UIImage(named: "re_back"), for: .normal)
            titleLabel2.textColor = .rgba(54, 54, 54, 1)
            img2.image = UIImage(named: "re_n")
            
            oneBtn3.setBackgroundImage(UIImage(named: "re_back"), for: .normal)
            titleLabel3.textColor = .rgba(54, 54, 54, 1)
            img3.image = UIImage(named: "re_n")
            
            oneBtn4.setBackgroundImage(UIImage(named: "re_back"), for: .normal)
            titleLabel4.textColor = .rgba(54, 54, 54, 1)
            
        default:
            break
        }
        
    }
    
    
    // MARK: - UI
    private func configUI() {
        backgroundColor = .white
        
        addSubviews([oneBtn,titleLabel,img,
                     oneBtn2,titleLabel2,img2,
                     oneBtn3,titleLabel3,img3,
                     oneBtn4,titleLabel4])
        
        oneBtn.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.width.height.equalTo(14)
            make.left.equalTo(18)
        }
        titleLabel.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(oneBtn.snp.right).offset(7)
            //make.width.equalTo(52)
        }
        img.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(titleLabel.snp.right).offset(6.5)
        }
        
        //2
        oneBtn2.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.width.height.equalTo(14)
            make.left.equalTo(img.snp.right).offset(10)
        }
        titleLabel2.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(oneBtn2.snp.right).offset(7)
            //make.width.equalTo(52)
        }
        img2.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(titleLabel2.snp.right).offset(6.5)
        }
        
        //3
        oneBtn3.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.width.height.equalTo(14)
            make.left.equalTo(img2.snp.right).offset(10)
        }
        titleLabel3.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(oneBtn3.snp.right).offset(7)
            //make.width.equalTo(52)
        }
        img3.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(titleLabel3.snp.right).offset(6.5)
        }
        //4
        oneBtn4.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.width.height.equalTo(14)
            make.left.equalTo(img3.snp.right).offset(10)
        }
        titleLabel4.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(oneBtn4.snp.right).offset(7)
            //make.width.equalTo(52)
        }
   
    }
    // MARK: - 1
    private lazy var oneBtn : UIButton = {
        let btn = UIButton()
        btn.setBackgroundImage(UIImage(named: "re_back"), for: .normal)
        btn.setTitle("1", for: .normal)
        btn.titleLabel?.font = .regular(13)
        return btn
    }()

    private lazy var titleLabel : UILabel = {
        let label = UILabel()
        label.font = .regular(13)
        label.textColor = .rgba(54, 54, 54, 1)
        label.text = " 填写信息"
        return label
    }()
   
    private lazy var img:UIImageView = {
        let img = UIImageView()
        img.image = UIImage(named: "re_n")
        return img
    }()
    
    //MARK: - 2
    private lazy var oneBtn2 : UIButton = {
        let btn = UIButton()
        btn.setBackgroundImage(UIImage(named: "re_normal"), for: .normal)
        btn.setTitle("2", for: .normal)
        btn.titleLabel?.font = .regular(13)
        return btn
    }()

    private lazy var titleLabel2 : UILabel = {
        let label = UILabel()
        label.font = .regular(13)
        label.textColor = .rgba(153, 153, 153, 1)
        label.text = " 教育与培训"
        return label
    }()
   
    private lazy var img2:UIImageView = {
        let img = UIImageView()
        img.image = UIImage(named: "re_nextN")
        return img
    }()
    //MARK: - 3
    private lazy var oneBtn3 : UIButton = {
        let btn = UIButton()
        btn.setBackgroundImage(UIImage(named: "re_normal"), for: .normal)
        btn.setTitle("3", for: .normal)
        btn.titleLabel?.font = .regular(13)
        return btn
    }()

    private lazy var titleLabel3 : UILabel = {
        let label = UILabel()
        label.font = .regular(13)
        label.textColor = .rgba(153, 153, 153, 1)
        label.text = " 工作经历"
        return label
    }()
   
    private lazy var img3:UIImageView = {
        let img = UIImageView()
        img.image = UIImage(named: "re_nextN")
        return img
    }()
    
    //MARK: - 4
    private lazy var oneBtn4 : UIButton = {
        let btn = UIButton()
        btn.setBackgroundImage(UIImage(named: "re_normal"), for: .normal)
        btn.setTitle("4", for: .normal)
        btn.titleLabel?.font = .regular(13)
        return btn
    }()

    private lazy var titleLabel4 : UILabel = {
        let label = UILabel()
        label.font = .regular(13)
        label.textColor = .rgba(153, 153, 153, 1)
        label.text = " 其他"
        return label
    }()
   
    
}
